<?php
$s = <<<EOF
src/main/webapp/js/base.js
src/main/webapp/WEB-INF/views/common/base.script.jsp
EOF;

$base = 'D:/web/';
$out = 'D:/patch'.date('YmdHis').'/';

$a = explode("\n", $s);
foreach ($a as $v) {
	$v = trim($v);
	$f = $out.$v;
	$d = pathinfo($f, PATHINFO_DIRNAME);
	if ( ! is_dir($d)) {
		mkdir($d, 0755, true);
	}
	echo $v, ' ... ';
	echo copy($base.$v, $f);
	echo PHP_EOL;
}
